package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PurOrderItemMapper;
import com.ruoyi.system.domain.PurOrderItem;
import com.ruoyi.system.service.IPurOrderItemService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采购订单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-16
 */
@Service
public class PurOrderItemServiceImpl implements IPurOrderItemService 
{
    @Autowired
    private PurOrderItemMapper purOrderItemMapper;

    /**
     * 查询采购订单明细
     * 
     * @param itemId 采购订单明细主键
     * @return 采购订单明细
     */
    @Override
    public PurOrderItem selectPurOrderItemByItemId(Long itemId)
    {
        return purOrderItemMapper.selectPurOrderItemByItemId(itemId);
    }

    /**
     * 查询采购订单明细列表
     * 
     * @param purOrderItem 采购订单明细
     * @return 采购订单明细
     */
    @Override
    public List<PurOrderItem> selectPurOrderItemList(PurOrderItem purOrderItem)
    {
        return purOrderItemMapper.selectPurOrderItemList(purOrderItem);
    }

    /**
     * 新增采购订单明细
     * 
     * @param purOrderItem 采购订单明细
     * @return 结果
     */
    @Override
    public int insertPurOrderItem(PurOrderItem purOrderItem)
    {
        return purOrderItemMapper.insertPurOrderItem(purOrderItem);
    }

    /**
     * 修改采购订单明细
     * 
     * @param purOrderItem 采购订单明细
     * @return 结果
     */
    @Override
    public int updatePurOrderItem(PurOrderItem purOrderItem)
    {
        return purOrderItemMapper.updatePurOrderItem(purOrderItem);
    }

    /**
     * 批量删除采购订单明细
     * 
     * @param itemIds 需要删除的采购订单明细主键
     * @return 结果
     */
    @Override
    public int deletePurOrderItemByItemIds(String itemIds)
    {
        return purOrderItemMapper.deletePurOrderItemByItemIds(Convert.toStrArray(itemIds));
    }

    /**
     * 删除采购订单明细信息
     * 
     * @param itemId 采购订单明细主键
     * @return 结果
     */
    @Override
    public int deletePurOrderItemByItemId(Long itemId)
    {
        return purOrderItemMapper.deletePurOrderItemByItemId(itemId);
    }
}
